home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 117
/
FreelogNo117-OctobreNovembre2013.iso
/
Musique
/
UniversalPatchFinder
/
UniversalPatchFinder-1.5.exe
/
{app}
/
createDb.sql
next >
Wrap
Text File
|
2012-11-14
|
3KB
|
81 lines
CREATE TABLE [Library] (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[Name] VARCHAR NOT NULL,
[Path] VARCHAR NOT NULL,
[Wallpaper] VARCHAR,
[Type] INTEGER NOT NULL DEFAULT 0);
CREATE TABLE "LibraryMenuItem" (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[Type] INTEGER NOT NULL,
[LibraryId] INTEGER NOT NULL REFERENCES [Library]([Id]) ON DELETE CASCADE,
[Path] VARCHAR NOT NULL);
CREATE TABLE [Patch] (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[LibraryId] INTEGER NOT NULL REFERENCES [Library]([Id]) ON DELETE CASCADE,
[Type] CHAR NOT NULL,
[Path] VARCHAR NOT NULL,
[Note] INTEGER NOT NULL DEFAULT 0,
[CRC32] INTEGER);
CREATE TABLE [PatchAttribute] (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[Name] VARCHAR NOT NULL,
[Type] INTEGER NOT NULL,
[UseDomainValues] BOOLEAN NOT NULL DEFAULT True);
CREATE UNIQUE INDEX [UniqueNameIndex] ON [PatchAttribute] ([Name]);
CREATE TABLE [PatchAttributeDomainValue] (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[AttributeId] INTEGER NOT NULL REFERENCES [PatchAttribute]([Id]) ON DELETE CASCADE,
[StrValue] VARCHAR,
[IntValue] INTEGER,
[floatValue] DECIMAL);
CREATE UNIQUE INDEX [UniqueFloatValue] ON [PatchAttributeDomainValue] ([AttributeId], [floatValue]);
CREATE UNIQUE INDEX [UniqueIntValue] ON [PatchAttributeDomainValue] ([AttributeId], [IntValue]);
CREATE UNIQUE INDEX [UniqueStrValue] ON [PatchAttributeDomainValue] ([AttributeId], [StrValue]);
CREATE TABLE "PatchAttributeInstance" (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[AttributeId] INTEGER NOT NULL REFERENCES [PatchAttribute]([Id]) ON DELETE CASCADE,
[IntValue] INTEGER,
[StrValue] VARCHAR,
[FloatValue] DECIMAL,
[DateValue] INTEGER,
[PatchId] INTEGER NOT NULL REFERENCES [Patch]([Id]) ON DELETE CASCADE,
[BoolValue] BOOLEAN,
[DomainValueId] INTEGER REFERENCES [PatchAttributeDomainValue]([Id]) ON DELETE CASCADE);
CREATE UNIQUE INDEX [UniqueDateValueByPatch] ON "PatchAttributeInstance" ([DateValue], [AttributeId], [PatchId]);
CREATE UNIQUE INDEX [UniqueFloatValueByPatch] ON "PatchAttributeInstance" ([FloatValue], [AttributeId], [PatchId]);
CREATE UNIQUE INDEX [UniqueIntValueByPatch] ON "PatchAttributeInstance" ([IntValue], [AttributeId], [PatchId]);
CREATE UNIQUE INDEX [UniqueStrValueByPatch] ON "PatchAttributeInstance" ([Id], [AttributeId], [PatchId]);
CREATE UNIQUE INDEX [UniqueDomainValueByPatch] ON "PatchAttributeInstance" ([AttributeId], [DomainValueId], [PatchId]);
CREATE TABLE [Tag] (
[Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[Name] VARCHAR NOT NULL);
CREATE TABLE [TagLibraryAssoc] (
[TagId] INTEGER NOT NULL,
[LibraryId] INTEGER NOT NULL REFERENCES [Library]([Id]) ON DELETE CASCADE,
CONSTRAINT [sqlite_autoindex_TagLibraryAssoc_1] PRIMARY KEY ([TagId], [LibraryId]));